In [1]:
# !pip install git+https://github.com/alberanid/rotopy
# !pip install pandas
# !pip install numpy
# !pip install matplotlib
# !pip install seaborn
# !pip install pandas_profiling --upgrade
# !pip install plotly
# !pip install wordcloud
# !pip install Flask
In [2]:
# Import Dataset
# Import File from Loacal Drive
# from google.colab import files
# data_to_load = files.upload()
# from google.colab import drive
# drive.mount('/content/drive')
In [3]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import collections
import plotly.express as px
import plotly.graph_objects as go
import nltk
import re
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
from nltk.util import ngrams
from plotly.subplots import make_subplots
from plotly.offline import iplot, init_notebook_mode
from wordcloud import WordCloud, STOPWORDS
from pandas_profiling import ProfileReport
%matplotlib inline
warnings.filterwarnings("ignore")
In [4]:
nltk.download('all')
[nltk_data] Downloading collection 'all'
[nltk_data]    | 
[nltk_data]    | Downloading package abc to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package abc is already up-to-date!
[nltk_data]    | Downloading package alpino to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package alpino is already up-to-date!
[nltk_data]    | Downloading package biocreative_ppi to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package biocreative_ppi is already up-to-date!
[nltk_data]    | Downloading package brown to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package brown is already up-to-date!
[nltk_data]    | Downloading package brown_tei to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package brown_tei is already up-to-date!
[nltk_data]    | Downloading package cess_cat to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cess_cat is already up-to-date!
[nltk_data]    | Downloading package cess_esp to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cess_esp is already up-to-date!
[nltk_data]    | Downloading package chat80 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package chat80 is already up-to-date!
[nltk_data]    | Downloading package city_database to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package city_database is already up-to-date!
[nltk_data]    | Downloading package cmudict to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cmudict is already up-to-date!
[nltk_data]    | Downloading package comparative_sentences to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package comparative_sentences is already up-to-
[nltk_data]    |       date!
[nltk_data]    | Downloading package comtrans to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package comtrans is already up-to-date!
[nltk_data]    | Downloading package conll2000 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2000 is already up-to-date!
[nltk_data]    | Downloading package conll2002 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2002 is already up-to-date!
[nltk_data]    | Downloading package conll2007 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2007 is already up-to-date!
[nltk_data]    | Downloading package crubadan to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package crubadan is already up-to-date!
[nltk_data]    | Downloading package dependency_treebank to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package dependency_treebank is already up-to-date!
[nltk_data]    | Downloading package dolch to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package dolch is already up-to-date!
[nltk_data]    | Downloading package europarl_raw to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package europarl_raw is already up-to-date!
[nltk_data]    | Downloading package floresta to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package floresta is already up-to-date!
[nltk_data]    | Downloading package framenet_v15 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package framenet_v15 is already up-to-date!
[nltk_data]    | Downloading package framenet_v17 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package framenet_v17 is already up-to-date!
[nltk_data]    | Downloading package gazetteers to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package gazetteers is already up-to-date!
[nltk_data]    | Downloading package genesis to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package genesis is already up-to-date!
[nltk_data]    | Downloading package gutenberg to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package gutenberg is already up-to-date!
[nltk_data]    | Downloading package ieer to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ieer is already up-to-date!
[nltk_data]    | Downloading package inaugural to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package inaugural is already up-to-date!
[nltk_data]    | Downloading package indian to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package indian is already up-to-date!
[nltk_data]    | Downloading package jeita to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package jeita is already up-to-date!
[nltk_data]    | Downloading package kimmo to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package kimmo is already up-to-date!
[nltk_data]    | Downloading package knbc to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package knbc is already up-to-date!
[nltk_data]    | Downloading package lin_thesaurus to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package lin_thesaurus is already up-to-date!
[nltk_data]    | Downloading package mac_morpho to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mac_morpho is already up-to-date!
[nltk_data]    | Downloading package machado to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package machado is already up-to-date!
[nltk_data]    | Downloading package masc_tagged to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package masc_tagged is already up-to-date!
[nltk_data]    | Downloading package moses_sample to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package moses_sample is already up-to-date!
[nltk_data]    | Downloading package movie_reviews to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package movie_reviews is already up-to-date!
[nltk_data]    | Downloading package names to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package names is already up-to-date!
[nltk_data]    | Downloading package nombank.1.0 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nombank.1.0 is already up-to-date!
[nltk_data]    | Downloading package nps_chat to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nps_chat is already up-to-date!
[nltk_data]    | Downloading package omw to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package omw is already up-to-date!
[nltk_data]    | Downloading package opinion_lexicon to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package opinion_lexicon is already up-to-date!
[nltk_data]    | Downloading package paradigms to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package paradigms is already up-to-date!
[nltk_data]    | Downloading package pil to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pil is already up-to-date!
[nltk_data]    | Downloading package pl196x to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pl196x is already up-to-date!
[nltk_data]    | Downloading package ppattach to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ppattach is already up-to-date!
[nltk_data]    | Downloading package problem_reports to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package problem_reports is already up-to-date!
[nltk_data]    | Downloading package propbank to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package propbank is already up-to-date!
[nltk_data]    | Downloading package ptb to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ptb is already up-to-date!
[nltk_data]    | Downloading package product_reviews_1 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package product_reviews_1 is already up-to-date!
[nltk_data]    | Downloading package product_reviews_2 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package product_reviews_2 is already up-to-date!
[nltk_data]    | Downloading package pros_cons to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pros_cons is already up-to-date!
[nltk_data]    | Downloading package qc to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package qc is already up-to-date!
[nltk_data]    | Downloading package reuters to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package reuters is already up-to-date!
[nltk_data]    | Downloading package rte to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package rte is already up-to-date!
[nltk_data]    | Downloading package semcor to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package semcor is already up-to-date!
[nltk_data]    | Downloading package senseval to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package senseval is already up-to-date!
[nltk_data]    | Downloading package sentiwordnet to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sentiwordnet is already up-to-date!
[nltk_data]    | Downloading package sentence_polarity to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sentence_polarity is already up-to-date!
[nltk_data]    | Downloading package shakespeare to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package shakespeare is already up-to-date!
[nltk_data]    | Downloading package sinica_treebank to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sinica_treebank is already up-to-date!
[nltk_data]    | Downloading package smultron to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package smultron is already up-to-date!
[nltk_data]    | Downloading package state_union to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package state_union is already up-to-date!
[nltk_data]    | Downloading package stopwords to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package stopwords is already up-to-date!
[nltk_data]    | Downloading package subjectivity to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package subjectivity is already up-to-date!
[nltk_data]    | Downloading package swadesh to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package swadesh is already up-to-date!
[nltk_data]    | Downloading package switchboard to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package switchboard is already up-to-date!
[nltk_data]    | Downloading package timit to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package timit is already up-to-date!
[nltk_data]    | Downloading package toolbox to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package toolbox is already up-to-date!
[nltk_data]    | Downloading package treebank to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package treebank is already up-to-date!
[nltk_data]    | Downloading package twitter_samples to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package twitter_samples is already up-to-date!
[nltk_data]    | Downloading package udhr to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package udhr is already up-to-date!
[nltk_data]    | Downloading package udhr2 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package udhr2 is already up-to-date!
[nltk_data]    | Downloading package unicode_samples to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package unicode_samples is already up-to-date!
[nltk_data]    | Downloading package universal_treebanks_v20 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package universal_treebanks_v20 is already up-to-
[nltk_data]    |       date!
[nltk_data]    | Downloading package verbnet to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package verbnet is already up-to-date!
[nltk_data]    | Downloading package verbnet3 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package verbnet3 is already up-to-date!
[nltk_data]    | Downloading package webtext to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package webtext is already up-to-date!
[nltk_data]    | Downloading package wordnet to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet is already up-to-date!
[nltk_data]    | Downloading package wordnet_ic to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet_ic is already up-to-date!
[nltk_data]    | Downloading package words to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package words is already up-to-date!
[nltk_data]    | Downloading package ycoe to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ycoe is already up-to-date!
[nltk_data]    | Downloading package rslp to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package rslp is already up-to-date!
[nltk_data]    | Downloading package maxent_treebank_pos_tagger to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package maxent_treebank_pos_tagger is already up-
[nltk_data]    |       to-date!
[nltk_data]    | Downloading package universal_tagset to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package universal_tagset is already up-to-date!
[nltk_data]    | Downloading package maxent_ne_chunker to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package maxent_ne_chunker is already up-to-date!
[nltk_data]    | Downloading package punkt to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package punkt is already up-to-date!
[nltk_data]    | Downloading package book_grammars to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package book_grammars is already up-to-date!
[nltk_data]    | Downloading package sample_grammars to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sample_grammars is already up-to-date!
[nltk_data]    | Downloading package spanish_grammars to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package spanish_grammars is already up-to-date!
[nltk_data]    | Downloading package basque_grammars to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package basque_grammars is already up-to-date!
[nltk_data]    | Downloading package large_grammars to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package large_grammars is already up-to-date!
[nltk_data]    | Downloading package tagsets to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package tagsets is already up-to-date!
[nltk_data]    | Downloading package snowball_data to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package snowball_data is already up-to-date!
[nltk_data]    | Downloading package bllip_wsj_no_aux to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package bllip_wsj_no_aux is already up-to-date!
[nltk_data]    | Downloading package word2vec_sample to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package word2vec_sample is already up-to-date!
[nltk_data]    | Downloading package panlex_swadesh to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package panlex_swadesh is already up-to-date!
[nltk_data]    | Downloading package mte_teip5 to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mte_teip5 is already up-to-date!
[nltk_data]    | Downloading package averaged_perceptron_tagger to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package averaged_perceptron_tagger is already up-
[nltk_data]    |       to-date!
[nltk_data]    | Downloading package averaged_perceptron_tagger_ru to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package averaged_perceptron_tagger_ru is already
[nltk_data]    |       up-to-date!
[nltk_data]    | Downloading package perluniprops to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package perluniprops is already up-to-date!
[nltk_data]    | Downloading package nonbreaking_prefixes to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nonbreaking_prefixes is already up-to-date!
[nltk_data]    | Downloading package vader_lexicon to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package vader_lexicon is already up-to-date!
[nltk_data]    | Downloading package porter_test to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package porter_test is already up-to-date!
[nltk_data]    | Downloading package wmt15_eval to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wmt15_eval is already up-to-date!
[nltk_data]    | Downloading package mwa_ppdb to
[nltk_data]    |     C:\Users\pawan\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mwa_ppdb is already up-to-date!
[nltk_data]    | 
[nltk_data]  Done downloading collection all
Out[4]:
True
In [5]:
# path = '/content/drive/MyDrive/Files/'

path = 'C:\\Users\\pawan\\OneDrive\\Desktop\\ott\\Data\\'
 
df_tvshows = pd.read_csv(path + 'otttvshows.csv')
 
df_tvshows.head()
Out[5]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country Language Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type
0 1 Snowpiercer 2013 18+ 6.9 94% NaN Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... Action,Drama,Sci-Fi,Thriller United States English Set seven years after the world has become a f... 60.0 tv series 3.0 1 0 0 0 1
1 2 Philadelphia 1993 13+ 8.8 80% NaN Charlie Day,Glenn Howerton,Rob McElhenney,Kait... Comedy United States English The gang, 5 raging alcoholic, narcissists run ... 22.0 tv series 18.0 1 0 0 0 1
2 3 Roma 2018 18+ 8.7 93% NaN Kevin McKidd,Ray Stevenson,Polly Walker,Kerry ... Action,Drama,History,Romance,War United Kingdom,United States English In this British historical drama, the turbulen... 52.0 tv series 2.0 1 0 0 0 1
3 4 Amy 2015 18+ 7.0 87% NaN Amy Brenneman,Richard T. Jones,Jessica Tuck,Ma... Drama United States English A family drama focused on three generations of... 60.0 tv series 6.0 1 0 1 1 1
4 5 The Young Offenders 2016 NaN 8.0 100% NaN Alex Murphy,Chris Walley,Hilary Rose,Dominic M... Comedy United Kingdom,Ireland English NaN 30.0 tv series 3.0 1 0 0 0 1
In [6]:
# profile = ProfileReport(df_tvshows)
# profile
In [7]:
def data_investigate(df):
    print('No of Rows : ', df.shape[0])
    print('No of Coloums : ', df.shape[1])
    print('**'*25)
    print('Colums Names : \n', df.columns)
    print('**'*25)
    print('Datatype of Columns : \n', df.dtypes)
    print('**'*25)
    print('Missing Values : ')
    c = df.isnull().sum()
    c = c[c > 0]
    print(c)
    print('**'*25)
    print('Missing vaules %age wise :\n')
    print((100*(df.isnull().sum()/len(df.index))))
    print('**'*25)
    print('Pictorial Representation : ')
    plt.figure(figsize = (10, 10))
    sns.heatmap(df.isnull(), yticklabels = False, cbar = False)
    plt.show()
In [8]:
data_investigate(df_tvshows)
No of Rows :  5432
No of Coloums :  20
**************************************************
Colums Names : 
 Index(['ID', 'Title', 'Year', 'Age', 'IMDb', 'Rotten Tomatoes', 'Directors',
       'Cast', 'Genres', 'Country', 'Language', 'Plotline', 'Runtime', 'Kind',
       'Seasons', 'Netflix', 'Hulu', 'Prime Video', 'Disney+', 'Type'],
      dtype='object')
**************************************************
Datatype of Columns : 
 ID                   int64
Title               object
Year                 int64
Age                 object
IMDb               float64
Rotten Tomatoes     object
Directors           object
Cast                object
Genres              object
Country             object
Language            object
Plotline            object
Runtime            float64
Kind                object
Seasons            float64
Netflix              int64
Hulu                 int64
Prime Video          int64
Disney+              int64
Type                 int64
dtype: object
**************************************************
Missing Values : 
Age                1954
IMDb                556
Rotten Tomatoes    4194
Directors          5158
Cast                486
Genres              323
Country             549
Language            638
Plotline           2493
Runtime            1410
Seasons             679
dtype: int64
**************************************************
Missing vaules %age wise :

ID                  0.000000
Title               0.000000
Year                0.000000
Age                35.972018
IMDb               10.235641
Rotten Tomatoes    77.209131
Directors          94.955817
Cast                8.946981
Genres              5.946244
Country            10.106775
Language           11.745214
Plotline           45.894698
Runtime            25.957290
Kind                0.000000
Seasons            12.500000
Netflix             0.000000
Hulu                0.000000
Prime Video         0.000000
Disney+             0.000000
Type                0.000000
dtype: float64
**************************************************
Pictorial Representation : 
In [9]:
# ID
# df_tvshows = df_tvshows.drop(['ID'], axis = 1)
 
# Age
df_tvshows.loc[df_tvshows['Age'].isnull() & df_tvshows['Disney+'] == 1, "Age"] = '13'
# df_tvshows.fillna({'Age' : 18}, inplace = True)
df_tvshows.fillna({'Age' : 'NR'}, inplace = True)
df_tvshows['Age'].replace({'all': '0'}, inplace = True)
df_tvshows['Age'].replace({'7+': '7'}, inplace = True)
df_tvshows['Age'].replace({'13+': '13'}, inplace = True)
df_tvshows['Age'].replace({'16+': '16'}, inplace = True)
df_tvshows['Age'].replace({'18+': '18'}, inplace = True)
# df_tvshows['Age'] = df_tvshows['Age'].astype(int)
 
# IMDb
# df_tvshows.fillna({'IMDb' : df_tvshows['IMDb'].mean()}, inplace = True)
# df_tvshows.fillna({'IMDb' : df_tvshows['IMDb'].median()}, inplace = True)
df_tvshows.fillna({'IMDb' : "NA"}, inplace = True)
 
# Rotten Tomatoes
df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'][df_tvshows['Rotten Tomatoes'].notnull()].str.replace('%', '').astype(int)
# df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'][df_tvshows['Rotten Tomatoes'].notnull()].astype(int)
# df_tvshows.fillna({'Rotten Tomatoes' : df_tvshows['Rotten Tomatoes'].mean()}, inplace = True)
# df_tvshows.fillna({'Rotten Tomatoes' : df_tvshows['Rotten Tomatoes'].median()}, inplace = True)
# df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'].astype(int)
df_tvshows.fillna({'Rotten Tomatoes' : "NA"}, inplace = True)
 
# Directors
# df_tvshows = df_tvshows.drop(['Directors'], axis = 1)
df_tvshows.fillna({'Directors' : "NA"}, inplace = True)
 
# Cast
df_tvshows.fillna({'Cast' : "NA"}, inplace = True)
 
# Genres
df_tvshows.fillna({'Genres': "NA"}, inplace = True)
 
# Country
df_tvshows.fillna({'Country': "NA"}, inplace = True)
 
# Language
df_tvshows.fillna({'Language': "NA"}, inplace = True)
 
# Plotline
df_tvshows.fillna({'Plotline': "NA"}, inplace = True)
 
# Runtime
# df_tvshows.fillna({'Runtime' : df_tvshows['Runtime'].mean()}, inplace = True)
# df_tvshows['Runtime'] = df_tvshows['Runtime'].astype(int)
df_tvshows.fillna({'Runtime' : "NA"}, inplace = True)
 
# Kind
# df_tvshows.fillna({'Kind': "NA"}, inplace = True)
 
# Type
# df_tvshows.fillna({'Type': "NA"}, inplace = True)
# df_tvshows = df_tvshows.drop(['Type'], axis = 1)
 
# Seasons
# df_tvshows.fillna({'Seasons': 1}, inplace = True)
df_tvshows.fillna({'Seasons': "NA"}, inplace = True)
# df_tvshows = df_tvshows.drop(['Seasons'], axis = 1)
# df_tvshows['Seasons'] = df_tvshows['Seasons'].astype(int)
# df_tvshows.fillna({'Seasons' : df_tvshows['Seasons'].mean()}, inplace = True)
# df_tvshows['Seasons'] = df_tvshows['Seasons'].astype(int)
 
# Service Provider
df_tvshows['Service Provider'] = df_tvshows.loc[:, ['Netflix', 'Prime Video', 'Disney+', 'Hulu']].idxmax(axis = 1)
# df_tvshows.drop(['Netflix','Prime Video','Disney+','Hulu'], axis = 1)

# Removing Duplicate and Missing Entries
df_tvshows.dropna(how = 'any', inplace = True)
df_tvshows.drop_duplicates(inplace = True)
In [10]:
data_investigate(df_tvshows)
No of Rows :  5432
No of Coloums :  21
**************************************************
Colums Names : 
 Index(['ID', 'Title', 'Year', 'Age', 'IMDb', 'Rotten Tomatoes', 'Directors',
       'Cast', 'Genres', 'Country', 'Language', 'Plotline', 'Runtime', 'Kind',
       'Seasons', 'Netflix', 'Hulu', 'Prime Video', 'Disney+', 'Type',
       'Service Provider'],
      dtype='object')
**************************************************
Datatype of Columns : 
 ID                   int64
Title               object
Year                 int64
Age                 object
IMDb                object
Rotten Tomatoes     object
Directors           object
Cast                object
Genres              object
Country             object
Language            object
Plotline            object
Runtime             object
Kind                object
Seasons             object
Netflix              int64
Hulu                 int64
Prime Video          int64
Disney+              int64
Type                 int64
Service Provider    object
dtype: object
**************************************************
Missing Values : 
Series([], dtype: int64)
**************************************************
Missing vaules %age wise :

ID                  0.0
Title               0.0
Year                0.0
Age                 0.0
IMDb                0.0
Rotten Tomatoes     0.0
Directors           0.0
Cast                0.0
Genres              0.0
Country             0.0
Language            0.0
Plotline            0.0
Runtime             0.0
Kind                0.0
Seasons             0.0
Netflix             0.0
Hulu                0.0
Prime Video         0.0
Disney+             0.0
Type                0.0
Service Provider    0.0
dtype: float64
**************************************************
Pictorial Representation : 
In [11]:
df_tvshows.head()
Out[11]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 1 Snowpiercer 2013 18 6.9 94 NA Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... Action,Drama,Sci-Fi,Thriller United States ... Set seven years after the world has become a f... 60 tv series 3 1 0 0 0 1 Netflix
1 2 Philadelphia 1993 13 8.8 80 NA Charlie Day,Glenn Howerton,Rob McElhenney,Kait... Comedy United States ... The gang, 5 raging alcoholic, narcissists run ... 22 tv series 18 1 0 0 0 1 Netflix
2 3 Roma 2018 18 8.7 93 NA Kevin McKidd,Ray Stevenson,Polly Walker,Kerry ... Action,Drama,History,Romance,War United Kingdom,United States ... In this British historical drama, the turbulen... 52 tv series 2 1 0 0 0 1 Netflix
3 4 Amy 2015 18 7 87 NA Amy Brenneman,Richard T. Jones,Jessica Tuck,Ma... Drama United States ... A family drama focused on three generations of... 60 tv series 6 1 0 1 1 1 Netflix
4 5 The Young Offenders 2016 NR 8 100 NA Alex Murphy,Chris Walley,Hilary Rose,Dominic M... Comedy United Kingdom,Ireland ... NA 30 tv series 3 1 0 0 0 1 Netflix

5 rows × 21 columns

In [12]:
df_tvshows.describe()
Out[12]:
ID Year Netflix Hulu Prime Video Disney+ Type
count 5432.000000 5432.000000 5432.000000 5432.000000 5432.000000 5432.000000 5432.0
mean 2716.500000 2010.668446 0.341311 0.293999 0.403351 0.033689 1.0
std 1568.227662 11.726176 0.474193 0.455633 0.490615 0.180445 0.0
min 1.000000 1901.000000 0.000000 0.000000 0.000000 0.000000 1.0
25% 1358.750000 2009.000000 0.000000 0.000000 0.000000 0.000000 1.0
50% 2716.500000 2014.000000 0.000000 0.000000 0.000000 0.000000 1.0
75% 4074.250000 2017.000000 1.000000 1.000000 1.000000 0.000000 1.0
max 5432.000000 2020.000000 1.000000 1.000000 1.000000 1.000000 1.0
In [13]:
df_tvshows.corr()
Out[13]:
ID Year Netflix Hulu Prime Video Disney+ Type
ID 1.000000 -0.031346 -0.646330 0.034293 0.441264 0.195409 NaN
Year -0.031346 1.000000 0.222316 -0.065807 -0.198675 -0.022741 NaN
Netflix -0.646330 0.222316 1.000000 -0.366515 -0.515086 -0.119344 NaN
Hulu 0.034293 -0.065807 -0.366515 1.000000 -0.377374 -0.075701 NaN
Prime Video 0.441264 -0.198675 -0.515086 -0.377374 1.000000 -0.151442 NaN
Disney+ 0.195409 -0.022741 -0.119344 -0.075701 -0.151442 1.000000 NaN
Type NaN NaN NaN NaN NaN NaN NaN
In [14]:
# df_tvshows.sort_values('Year', ascending = True)
# df_tvshows.sort_values('Rotten Tomatoes', ascending = False)
In [15]:
# df_tvshows.to_csv(path_or_buf= '/content/drive/MyDrive/Files/updated_otttvshows.csv', index = False)
 
# path = '/content/drive/MyDrive/Files/'
 
# udf_tvshows = pd.read_csv(path + 'updated_otttvshows.csv')
 
# udf_tvshows
In [16]:
# df_netflix_tvshows = df_tvshows.loc[(df_tvshows['Netflix'] > 0)]
# df_hulu_tvshows = df_tvshows.loc[(df_tvshows['Hulu'] > 0)]
# df_prime_video_tvshows = df_tvshows.loc[(df_tvshows['Prime Video'] > 0)]
# df_disney_tvshows = df_tvshows.loc[(df_tvshows['Disney+'] > 0)]
In [17]:
df_netflix_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 1) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 0)]
df_hulu_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 1) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 0)]
df_prime_video_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 1 ) & (df_tvshows['Disney+'] == 0)]
df_disney_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 1)]
In [18]:
df_tvshows_roto = df_tvshows.copy()
In [19]:
df_tvshows_roto.drop(df_tvshows_roto.loc[df_tvshows_roto['Rotten Tomatoes'] == "NA"].index, inplace = True)
# df_tvshows_roto = df_tvshows_roto[df_tvshows_roto.Rotten Tomatoes != "NA"]
df_tvshows_roto['Rotten Tomatoes'] = df_tvshows_roto['Rotten Tomatoes'].astype(int)
In [20]:
# Creating distinct dataframes only with the tvshows present on individual streaming platforms
netflix_roto_tvshows = df_tvshows_roto.loc[df_tvshows_roto['Netflix'] == 1]
hulu_roto_tvshows = df_tvshows_roto.loc[df_tvshows_roto['Hulu'] == 1]
prime_video_roto_tvshows = df_tvshows_roto.loc[df_tvshows_roto['Prime Video'] == 1]
disney_roto_tvshows = df_tvshows_roto.loc[df_tvshows_roto['Disney+'] == 1]
In [21]:
df_tvshows_roto_group = df_tvshows_roto.copy()
In [22]:
plt.figure(figsize = (10, 10))
corr = df_tvshows_roto.corr()
# Plot figsize
fig, ax = plt.subplots(figsize=(10, 8))
# Generate Heat Map, allow annotations and place floats in map
sns.heatmap(corr, cmap = 'magma', annot = True, fmt = ".2f")
# Apply xticks
plt.xticks(range(len(corr.columns)), corr.columns);
# Apply yticks
plt.yticks(range(len(corr.columns)), corr.columns)
# show plot
plt.show()
fig.show()
<Figure size 720x720 with 0 Axes>
In [23]:
df_roto_high_tvshows = df_tvshows_roto.sort_values(by = 'Rotten Tomatoes', ascending = False).reset_index()
df_roto_high_tvshows = df_roto_high_tvshows.drop(['index'], axis = 1)
# filter = (df_tvshows_roto['Rotten Tomatoes'] == (df_tvshows_roto['Rotten Tomatoes'].max()))
# df_roto_high_tvshows = df_tvshows_roto[filter]
 
# highest_rated_tvshows = df_tvshows_roto.loc[df_tvshows_roto['Rotten Tomatoes'].idxmax()]
 
print('\nTV Shows with Highest Ever Rotten Tomatoes  are : \n')
df_roto_high_tvshows.head(5)
TV Shows with Highest Ever Rotten Tomatoes  are : 

Out[23]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 2275 Gravity Falls 2012 7 8.9 100 NA Jason Ritter,Alex Hirsch,Kristen Schaal,Linda ... Animation,Adventure,Comedy,Drama,Family,Fantas... United States,Argentina,Australia,United Kingd... ... In a world populated with superhumans, the sup... 23 tv series 2 0 1 0 1 1 Disney+
1 791 Hyperdrive 2019 7 6.7 100 NA Nick Frost,Kevin Eldon,Miranda Hart,Dan Antopo... Comedy,Sci-Fi United Kingdom ... As a gifted young football athlete from Bristo... 29 tv series 2 1 0 0 0 1 Netflix
2 2345 Cowboy Bebop 1998 7 8.9 100 NA Kôichi Yamadera,Unshô Ishizuka,Steve Blum,Beau... Animation,Action,Adventure,Comedy,Drama,Sci-Fi... Japan ... From the earliest times, the humanity knows ab... 24 tv series 1 0 1 0 0 1 Hulu
3 2340 Elfen Lied 2004 16 8 100 NA Sanae Kobayashi,Chihiro Suzuki,Mamiko Noto,Ada... Animation,Action,Drama,Horror,Mystery,Sci-Fi,T... Japan ... NA 24 tv series 1 0 1 1 0 1 Prime Video
4 2322 Spaced 1999 16 8.5 100 NA Jessica Hynes,Simon Pegg,Julia Deakin,Nick Fro... Action,Comedy United Kingdom ... The numerous miraculous rescues by the local w... 25 tv series 2 0 1 0 0 1 Hulu

5 rows × 21 columns

In [24]:
fig = px.bar(y = df_roto_high_tvshows['Title'][:15],
             x = df_roto_high_tvshows['Rotten Tomatoes'][:15], 
             color = df_roto_high_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Highest Rotten Tomatoes : All Platforms')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [25]:
df_roto_low_tvshows = df_tvshows_roto.sort_values(by = 'Rotten Tomatoes', ascending = True).reset_index()
df_roto_low_tvshows = df_roto_low_tvshows.drop(['index'], axis = 1)
# filter = (df_tvshows_roto['Rotten Tomatoes'] == (df_tvshows_roto['Rotten Tomatoes'].min()))
# df_roto_low_tvshows = df_tvshows_roto[filter]

print('\nTV Shows with Lowest Ever Rotten Tomatoes  are : \n')
df_roto_low_tvshows.head(5)
TV Shows with Lowest Ever Rotten Tomatoes  are : 

Out[25]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 1804 Real Rob 2015 18 6.5 0 NA Rob Schneider,Patricia Maya Schneider,Jamie Li... Comedy United States ... NA 30 tv series 2 1 0 0 0 1 Netflix
1 5120 Baby Talk 2017 NR 4.2 0 NA Tony Danza,Paul Jessup,Ryan Jessup,Mary Page K... Comedy United States ... Around the Next Bend is the story of two frien... 30 tv series 2 0 0 1 0 1 Prime Video
2 119 Switching Goals 1999 0 5.1 0 Mike Jeavons Mike Jeavons Action,Comedy,Family,Romance NA ... NA 12 tv series NA 0 1 0 0 1 Hulu
3 10 Rainbow 2015 NR 7 0 Nagesh Kukunoor Geoffrey Hayes,Roy Skelton,Stanley Bates,Rod B... Animation,Family United Kingdom ... NA 22 tv series 20 1 0 0 0 1 Netflix
4 4429 Baby Talk 1991 0 4.2 0 NA Tony Danza,Paul Jessup,Ryan Jessup,Mary Page K... Comedy United States ... NA 30 tv series 2 0 0 1 0 1 Prime Video

5 rows × 21 columns

In [26]:
fig = px.bar(y = df_roto_low_tvshows['Title'][:15],
             x = df_roto_low_tvshows['Rotten Tomatoes'][:15], 
             color = df_roto_low_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Lowest Rotten Tomatoes : All Platforms')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [27]:
print(f'''
      Total '{df_tvshows_roto['Rotten Tomatoes'].unique().shape[0]}' unique Rotten Tomatoes s were Given, They were Like this,\n
      
{df_tvshows_roto.sort_values(by = 'Rotten Tomatoes', ascending = False)['Rotten Tomatoes'].unique()}\n
 
      The Highest Ever Rotten Tomatoes Ever Any TV Show Got is '{df_roto_high_tvshows['Title'][0]}' : '{df_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
 
      The Lowest Ever Rotten Tomatoes Ever Any TV Show Got is '{df_roto_low_tvshows['Title'][0]}' : '{df_roto_low_tvshows['Rotten Tomatoes'].min()}'\n
      ''')
      Total '92' unique Rotten Tomatoes s were Given, They were Like this,

      
[100  99  98  97  96  95  94  93  92  91  90  89  88  87  86  85  84  83
  82  81  80  79  78  77  76  75  74  73  72  71  70  69  68  67  66  65
  64  63  62  61  60  59  58  57  56  55  54  53  52  51  50  49  48  47
  46  45  44  43  42  41  40  39  38  37  36  35  34  33  32  31  30  29
  28  27  26  25  24  23  22  21  20  19  18  17  14  12  11  10   9   8
   6   0]

 
      The Highest Ever Rotten Tomatoes Ever Any TV Show Got is 'Gravity Falls' : '100'

 
      The Lowest Ever Rotten Tomatoes Ever Any TV Show Got is 'Real Rob' : '0'

      
In [28]:
netflix_roto_high_tvshows = df_roto_high_tvshows.loc[df_roto_high_tvshows['Netflix']==1].reset_index()
netflix_roto_high_tvshows = netflix_roto_high_tvshows.drop(['index'], axis = 1)
 
netflix_roto_low_tvshows = df_roto_low_tvshows.loc[df_roto_low_tvshows['Netflix']==1].reset_index()
netflix_roto_low_tvshows = netflix_roto_low_tvshows.drop(['index'], axis = 1)
 
netflix_roto_high_tvshows.head(5)
Out[28]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 791 Hyperdrive 2019 7 6.7 100 NA Nick Frost,Kevin Eldon,Miranda Hart,Dan Antopo... Comedy,Sci-Fi United Kingdom ... As a gifted young football athlete from Bristo... 29 tv series 2 1 0 0 0 1 Netflix
1 593 Fauda 2015 18 8.2 100 NA Lior Raz,Itzik Cohen,Neta Garty,Rona-Lee Shim'... Action,Drama,Thriller Israel ... In crime ridden Gotham City, Thomas and Martha... 60 tv series 3 1 0 0 0 1 Netflix
2 784 The Hollow 2018 7 7.2 100 NA Ashleigh Ball,Connor Parnall,Adrian Petriw,Mar... Animation,Drama,Family,Mystery,Sci-Fi Canada ... A rare atmospheric phenomenon allows a New Yor... 24 tv series 2 1 0 0 0 1 Netflix
3 792 Time: The Kalief Browder Story 2017 16 8.5 100 NA Kalief Browder,Venida Browder,Jay-Z,Paul Prest... Documentary,Biography United States ... NA NA tv series 1 1 0 0 0 1 Netflix
4 782 Flowers 2016 16 8.2 100 NA Sophia Di Martino,Olivia Colman,Julian Barratt... Comedy,Drama United Kingdom ... NA 30 tv series 2 1 0 0 0 1 Netflix

5 rows × 21 columns

In [29]:
fig = px.bar(y = netflix_roto_high_tvshows['Title'][:15],
             x = netflix_roto_high_tvshows['Rotten Tomatoes'][:15], 
             color = netflix_roto_high_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Highest Rotten Tomatoes : Netflix')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [30]:
fig = px.bar(y = netflix_roto_low_tvshows['Title'][:15],
             x = netflix_roto_low_tvshows['Rotten Tomatoes'][:15], 
             color = netflix_roto_low_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Lowest Rotten Tomatoes : Netflix')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [31]:
hulu_roto_high_tvshows = df_roto_high_tvshows.loc[df_roto_high_tvshows['Hulu']==1].reset_index()
hulu_roto_high_tvshows = hulu_roto_high_tvshows.drop(['index'], axis = 1)
 
hulu_roto_low_tvshows = df_roto_low_tvshows.loc[df_roto_low_tvshows['Hulu']==1].reset_index()
hulu_roto_low_tvshows = hulu_roto_low_tvshows.drop(['index'], axis = 1)
 
hulu_roto_high_tvshows.head(5)
Out[31]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 2275 Gravity Falls 2012 7 8.9 100 NA Jason Ritter,Alex Hirsch,Kristen Schaal,Linda ... Animation,Adventure,Comedy,Drama,Family,Fantas... United States,Argentina,Australia,United Kingd... ... In a world populated with superhumans, the sup... 23 tv series 2 0 1 0 1 1 Disney+
1 2345 Cowboy Bebop 1998 7 8.9 100 NA Kôichi Yamadera,Unshô Ishizuka,Steve Blum,Beau... Animation,Action,Adventure,Comedy,Drama,Sci-Fi... Japan ... From the earliest times, the humanity knows ab... 24 tv series 1 0 1 0 0 1 Hulu
2 2340 Elfen Lied 2004 16 8 100 NA Sanae Kobayashi,Chihiro Suzuki,Mamiko Noto,Ada... Animation,Action,Drama,Horror,Mystery,Sci-Fi,T... Japan ... NA 24 tv series 1 0 1 1 0 1 Prime Video
3 2322 Spaced 1999 16 8.5 100 NA Jessica Hynes,Simon Pegg,Julia Deakin,Nick Fro... Action,Comedy United Kingdom ... The numerous miraculous rescues by the local w... 25 tv series 2 0 1 0 0 1 Hulu
4 2318 Tokyo Ghoul 2014 18 7.8 100 NA Natsuki Hanae,Austin Tindle,Sora Amamiya,Brina... Animation,Action,Drama,Fantasy,Horror,Thriller Japan ... The series follows John Nolan, a 40-year-old m... 24 tv series 1 0 1 0 0 1 Hulu

5 rows × 21 columns

In [32]:
fig = px.bar(y = hulu_roto_high_tvshows['Title'][:15],
             x = hulu_roto_high_tvshows['Rotten Tomatoes'][:15], 
             color = hulu_roto_high_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Highest Rotten Tomatoes : Hulu')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [33]:
fig = px.bar(y = hulu_roto_low_tvshows['Title'][:15],
             x = hulu_roto_low_tvshows['Rotten Tomatoes'][:15], 
             color = hulu_roto_low_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Lowest Rotten Tomatoes : Hulu')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [34]:
prime_video_roto_high_tvshows = df_roto_high_tvshows.loc[df_roto_high_tvshows['Prime Video']==1].reset_index()
prime_video_roto_high_tvshows = prime_video_roto_high_tvshows.drop(['index'], axis = 1)
 
prime_video_roto_low_tvshows = df_roto_low_tvshows.loc[df_roto_low_tvshows['Prime Video']==1].reset_index()
prime_video_roto_low_tvshows = prime_video_roto_low_tvshows.drop(['index'], axis = 1)
 
prime_video_roto_high_tvshows.head(5)
Out[34]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 2340 Elfen Lied 2004 16 8 100 NA Sanae Kobayashi,Chihiro Suzuki,Mamiko Noto,Ada... Animation,Action,Drama,Horror,Mystery,Sci-Fi,T... Japan ... NA 24 tv series 1 0 1 1 0 1 Prime Video
1 321 Utopia 1951 7 6.7 100 NA John Cusack,Ashleigh LaThrop,Dan Byrd,Desmin B... Action,Drama,Mystery,Sci-Fi,Thriller United States ... An acclaimed documentary feature exploring the... 55 tv series 1 0 0 1 0 1 Prime Video
2 2288 Mr. Bean 1990 7 8.5 100 NA Rowan Atkinson,Robin Driscoll,Matilda Ziegler,... Comedy,Family United Kingdom ... The story of an inner-city Los Angeles police ... 25 tv series 1 0 1 1 0 1 Prime Video
3 2511 Yu Yu Hakusho 1992 7 8.5 100 NA Nozomu Sasaki,Justin Cook,Christopher Sabat,Cy... Animation,Action,Adventure,Comedy,Drama,Fantas... NA ... Follows a deep-cover operative named Martin Od... 24 tv series 1 0 1 1 0 1 Prime Video
4 199 Sanctuary 2017 0 7.3 100 NA Amanda Tapping,Robin Dunne,Christopher Heyerda... Action,Drama,Fantasy,Mystery,Sci-Fi Canada ... NA 44 tv series 4 0 0 1 0 1 Prime Video

5 rows × 21 columns

In [35]:
fig = px.bar(y = prime_video_roto_high_tvshows['Title'][:15],
             x = prime_video_roto_high_tvshows['Rotten Tomatoes'][:15], 
             color = prime_video_roto_high_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Highest Rotten Tomatoes : Prime Video')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [36]:
fig = px.bar(y = prime_video_roto_low_tvshows['Title'][:15],
             x = prime_video_roto_low_tvshows['Rotten Tomatoes'][:15], 
             color = prime_video_roto_low_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Lowest Rotten Tomatoes : Prime Video')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [37]:
disney_roto_high_tvshows = df_roto_high_tvshows.loc[df_roto_high_tvshows['Disney+']==1].reset_index()
disney_roto_high_tvshows = disney_roto_high_tvshows.drop(['index'], axis = 1)
 
disney_roto_low_tvshows = df_roto_low_tvshows.loc[df_roto_low_tvshows['Disney+']==1].reset_index()
disney_roto_low_tvshows = disney_roto_low_tvshows.drop(['index'], axis = 1)
 
disney_roto_high_tvshows.head(5)
Out[37]:
ID Title Year Age IMDb Rotten Tomatoes Directors Cast Genres Country ... Plotline Runtime Kind Seasons Netflix Hulu Prime Video Disney+ Type Service Provider
0 2275 Gravity Falls 2012 7 8.9 100 NA Jason Ritter,Alex Hirsch,Kristen Schaal,Linda ... Animation,Adventure,Comedy,Drama,Family,Fantas... United States,Argentina,Australia,United Kingd... ... In a world populated with superhumans, the sup... 23 tv series 2 0 1 0 1 1 Disney+
1 5308 Lizzie McGuire 2001 7 6.6 100 NA Hilary Duff,Lalaine,Adam Lamberg,Jake Thomas,H... Comedy,Drama,Family United States ... NA 30 tv series 2 0 0 0 1 1 Disney+
2 5318 Disney Gallery / Star Wars: The Mandalorian 2020 7 8.5 100 Josiah Swanson Josiah Swanson Talk-Show NA ... NA NA tv series NA 0 0 0 1 1 Disney+
3 5301 DuckTales 2017 0 8.3 100 NA David Tennant,Ben Schwartz,Danny Pudi,Bobby Mo... Animation,Action,Adventure,Comedy,Family,Fanta... United States ... NA 21 tv series 3 0 0 0 1 1 Disney+
4 5304 The Imagineering Story 2019 0 9 100 NA Tom Morris,Kevin Rafferty,Angela Bassett,Tom F... Documentary United States ... Raven Baxter is a teenager. She can see glimps... 60 tv series 1 0 0 0 1 1 Disney+

5 rows × 21 columns

In [38]:
fig = px.bar(y = disney_roto_high_tvshows['Title'][:15],
             x = disney_roto_high_tvshows['Rotten Tomatoes'][:15], 
             color = disney_roto_high_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Highest Rotten Tomatoes : Disney+')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [39]:
fig = px.bar(y = disney_roto_low_tvshows['Title'][:15],
             x = disney_roto_low_tvshows['Rotten Tomatoes'][:15], 
             color = disney_roto_low_tvshows['Rotten Tomatoes'][:15],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Lowest Rotten Tomatoes : Disney+')

fig.update_layout(plot_bgcolor = 'white')
fig.show()
In [40]:
print(f'''
      The TV Show with Highest Rotten Tomatoes  Ever Got is '{df_roto_high_tvshows['Title'][0]}' : '{df_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
      The TV Show with Lowest Rotten Tomatoes  Ever Got is '{df_roto_low_tvshows['Title'][0]}' : '{df_roto_low_tvshows['Rotten Tomatoes'].min()}'\n
      
      The TV Show with Highest Rotten Tomatoes  on 'Netflix' is '{netflix_roto_high_tvshows['Title'][0]}' : '{netflix_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
      The TV Show with Lowest Rotten Tomatoes  on 'Netflix' is '{netflix_roto_low_tvshows['Title'][0]}' : '{netflix_roto_low_tvshows['Rotten Tomatoes'].min()}'\n
      
      The TV Show with Highest Rotten Tomatoes  on 'Hulu' is '{hulu_roto_high_tvshows['Title'][0]}' : '{hulu_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
      The TV Show with Lowest Rotten Tomatoes  on 'Hulu' is '{hulu_roto_low_tvshows['Title'][0]}' : '{hulu_roto_low_tvshows['Rotten Tomatoes'].min()}'\n
      
      The TV Show with Highest Rotten Tomatoes  on 'Prime Video' is '{prime_video_roto_high_tvshows['Title'][0]}' : '{prime_video_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
      The TV Show with Lowest Rotten Tomatoes  on 'Prime Video' is '{prime_video_roto_low_tvshows['Title'][0]}' : '{prime_video_roto_low_tvshows['Rotten Tomatoes'].min()}'\n
      
      The TV Show with Highest Rotten Tomatoes  on 'Disney+' is '{disney_roto_high_tvshows['Title'][0]}' : '{disney_roto_high_tvshows['Rotten Tomatoes'].max()}'\n
      The TV Show with Lowest Rotten Tomatoes  on 'Disney+' is '{disney_roto_low_tvshows['Title'][0]}' : '{disney_roto_low_tvshows['Rotten Tomatoes'].min()}'\n 
      ''')
      The TV Show with Highest Rotten Tomatoes  Ever Got is 'Gravity Falls' : '100'

      The TV Show with Lowest Rotten Tomatoes  Ever Got is 'Real Rob' : '0'

      
      The TV Show with Highest Rotten Tomatoes  on 'Netflix' is 'Hyperdrive' : '100'

      The TV Show with Lowest Rotten Tomatoes  on 'Netflix' is 'Real Rob' : '0'

      
      The TV Show with Highest Rotten Tomatoes  on 'Hulu' is 'Gravity Falls' : '100'

      The TV Show with Lowest Rotten Tomatoes  on 'Hulu' is 'Switching Goals' : '0'

      
      The TV Show with Highest Rotten Tomatoes  on 'Prime Video' is 'Elfen Lied' : '100'

      The TV Show with Lowest Rotten Tomatoes  on 'Prime Video' is 'Baby Talk' : '0'

      
      The TV Show with Highest Rotten Tomatoes  on 'Disney+' is 'Gravity Falls' : '100'

      The TV Show with Lowest Rotten Tomatoes  on 'Disney+' is 'Zapped' : '6'
 
      
In [41]:
print(f'''
      Accross All Platforms the Average Rotten Tomatoes  is '{round(df_tvshows_roto['Rotten Tomatoes'].mean(), ndigits = 2)}'\n
      The Average Rotten Tomatoes  on 'Netflix' is '{round(netflix_roto_tvshows['Rotten Tomatoes'].mean(), ndigits = 2)}'\n
      The Average Rotten Tomatoes  on 'Hulu' is '{round(hulu_roto_tvshows['Rotten Tomatoes'].mean(), ndigits = 2)}'\n
      The Average Rotten Tomatoes  on 'Prime Video' is '{round(prime_video_roto_tvshows['Rotten Tomatoes'].mean(), ndigits = 2)}'\n
      The Average Rotten Tomatoes  on 'Disney+' is '{round(disney_roto_tvshows['Rotten Tomatoes'].mean(), ndigits = 2)}'\n 
      ''')
      Accross All Platforms the Average Rotten Tomatoes  is '75.52'

      The Average Rotten Tomatoes  on 'Netflix' is '77.96'

      The Average Rotten Tomatoes  on 'Hulu' is '77.04'

      The Average Rotten Tomatoes  on 'Prime Video' is '71.16'

      The Average Rotten Tomatoes  on 'Disney+' is '76.23'
 
      
In [42]:
f, ax = plt.subplots(1, 2 , figsize = (20, 5))
sns.distplot(df_tvshows_roto['Rotten Tomatoes'],bins = 20, kde = True, ax = ax[0])
sns.boxplot(df_tvshows_roto['Rotten Tomatoes'], ax = ax[1])
plt.show()
In [43]:
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Rotten Tomatoes s Per Platform')
 
# Plotting the information from each dataset into a histogram
sns.histplot(prime_video_roto_tvshows['Rotten Tomatoes'][:100], color = 'lightblue', legend = True, kde = True)
sns.histplot(netflix_roto_tvshows['Rotten Tomatoes'][:100], color = 'red', legend = True, kde = True)
sns.histplot(hulu_roto_tvshows['Rotten Tomatoes'][:100], color = 'lightgreen', legend = True, kde = True)
sns.histplot(disney_roto_tvshows['Rotten Tomatoes'][:100], color = 'darkblue', legend = True, kde = True) 
 
# Setting the legend
plt.legend(['Prime Video', 'Netflix', 'Hulu', 'Disney+'])
plt.show()
In [44]:
def round_val(data):
    if str(data) != 'nan':
        return round(data)
        
def round_fix(data):
    if data in range(0,11):
        # print(data)
        return 10
    if data in range(11,21):
        return 20
    if data in range(21,31):
        return 30
    if data in range(31,41):
        return 40
    if data in range(41,51):
        return 50
    if data in range(51,61):
        return 60
    if data in range(61,71):
        return 70
    if data in range(71,81):
        return 80
    if data in range(81,91):
        return 90
    if data in range(91,101):
        return 100
In [45]:
df_tvshows_roto_group['Rotten Tomatoes Group'] = df_tvshows_roto['Rotten Tomatoes'].apply(round_fix)
 
roto_values = df_tvshows_roto_group['Rotten Tomatoes Group'].value_counts().sort_index(ascending = False).tolist()
roto_index = df_tvshows_roto_group['Rotten Tomatoes Group'].value_counts().sort_index(ascending = False).index
 
# roto_values, roto_index
In [46]:
roto_group_count = df_tvshows_roto_group.groupby('Rotten Tomatoes Group')['Title'].count()
roto_group_tvshows = df_tvshows_roto_group.groupby('Rotten Tomatoes Group')[['Netflix', 'Hulu', 'Prime Video', 'Disney+']].sum()
roto_group_data_tvshows = pd.concat([roto_group_count, roto_group_tvshows], axis = 1).reset_index().rename(columns = {'Title' : 'TV Shows Count'})
roto_group_data_tvshows = roto_group_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)
In [47]:
# Rotten Tomatoes Group with TV Shows Counts - All Platforms Combined
roto_group_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)
Out[47]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
9 100 393 194 123 96 11
8 90 291 115 104 89 9
7 80 164 65 62 49 1
6 70 107 35 35 35 4
5 60 78 29 26 28 1
4 50 68 26 16 29 2
3 40 60 26 15 20 0
1 20 30 9 5 16 2
2 30 29 10 6 14 0
0 10 18 7 7 6 1
In [48]:
roto_group_data_tvshows.sort_values(by = 'Rotten Tomatoes Group', ascending = False)
Out[48]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
9 100 393 194 123 96 11
8 90 291 115 104 89 9
7 80 164 65 62 49 1
6 70 107 35 35 35 4
5 60 78 29 26 28 1
4 50 68 26 16 29 2
3 40 60 26 15 20 0
2 30 29 10 6 14 0
1 20 30 9 5 16 2
0 10 18 7 7 6 1
In [49]:
fig = px.bar(y = roto_group_data_tvshows['TV Shows Count'],
             x = roto_group_data_tvshows['Rotten Tomatoes Group'], 
             color = roto_group_data_tvshows['Rotten Tomatoes Group'],
             color_continuous_scale = 'Teal_r', 
             labels = { 'y' : 'TV Shows Count', 'x' : 'Rotten Tomatoes : Rating'},
             title  = 'TV Shows with Group Rotten Tomatoes : All Platforms')

fig.update_layout(plot_bgcolor = "white")
fig.show()
In [50]:
fig = px.pie(roto_group_data_tvshows[:10],
             names = roto_group_data_tvshows['Rotten Tomatoes Group'],
             values = roto_group_data_tvshows['TV Shows Count'],
             color = roto_group_data_tvshows['TV Shows Count'],
             color_discrete_sequence = px.colors.sequential.Teal)

fig.update_traces(textinfo = 'percent+label',
                  title = 'TV Shows Count based on Rotten Tomatoes Group')
fig.show()
In [51]:
df_roto_group_high_tvshows = roto_group_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False).reset_index()
df_roto_group_high_tvshows = df_roto_group_high_tvshows.drop(['index'], axis = 1)
# filter = (roto_group_data_tvshows['TV Shows Count'] ==  (roto_group_data_tvshows['TV Shows Count'].max()))
# df_roto_group_high_tvshows = roto_group_data_tvshows[filter]
 
# highest_rated_tvshows = roto_group_data_tvshows.loc[roto_group_data_tvshows['TV Shows Count'].idxmax()]
 
# print('\nRotten Tomatoes with Highest Ever TV Shows Count are : All Platforms Combined\n')
df_roto_group_high_tvshows.head(5)
Out[51]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 100 393 194 123 96 11
1 90 291 115 104 89 9
2 80 164 65 62 49 1
3 70 107 35 35 35 4
4 60 78 29 26 28 1
In [52]:
df_roto_group_low_tvshows = roto_group_data_tvshows.sort_values(by = 'TV Shows Count', ascending = True).reset_index()
df_roto_group_low_tvshows = df_roto_group_low_tvshows.drop(['index'], axis = 1)
# filter = (roto_group_data_tvshows['TV Shows Count'] = =  (roto_group_data_tvshows['TV Shows Count'].min()))
# df_roto_group_low_tvshows = roto_group_data_tvshows[filter]
 
# print('\nRotten Tomatoes with Lowest Ever TV Shows Count are : All Platforms Combined\n')
df_roto_group_low_tvshows.head(5)
Out[52]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 10 18 7 7 6 1
1 30 29 10 6 14 0
2 20 30 9 5 16 2
3 40 60 26 15 20 0
4 50 68 26 16 29 2
In [53]:
print(f'''
      Total '{df_tvshows_roto['Rotten Tomatoes'].count()}' Titles are available on All Platforms, out of which\n
      You Can Choose to see TV Shows from Total '{roto_group_data_tvshows['Rotten Tomatoes Group'].unique().shape[0]}' Rotten Tomatoes Group, They were Like this, \n
 
      {roto_group_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)['Rotten Tomatoes Group'].unique()} etc. \n
 
      The Rotten Tomatoes Group with Highest TV Shows Count have '{roto_group_data_tvshows['TV Shows Count'].max()}' TV Shows Available is '{df_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}', &\n
      The Rotten Tomatoes Group with Lowest TV Shows Count have '{roto_group_data_tvshows['TV Shows Count'].min()}' TV Shows Available is '{df_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}'
      ''')
      Total '1238' Titles are available on All Platforms, out of which

      You Can Choose to see TV Shows from Total '10' Rotten Tomatoes Group, They were Like this, 

 
      [100  90  80  70  60  50  40  20  30  10] etc. 

 
      The Rotten Tomatoes Group with Highest TV Shows Count have '393' TV Shows Available is '100', &

      The Rotten Tomatoes Group with Lowest TV Shows Count have '18' TV Shows Available is '10'
      
In [54]:
netflix_roto_group_tvshows = roto_group_data_tvshows[roto_group_data_tvshows['Netflix'] !=  0].sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_roto_group_tvshows = netflix_roto_group_tvshows.drop(['index', 'Hulu', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
 
netflix_roto_group_high_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_roto_group_high_tvshows = netflix_roto_group_high_tvshows.drop(['index'], axis = 1)
 
netflix_roto_group_low_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Netflix', ascending = True).reset_index()
netflix_roto_group_low_tvshows = netflix_roto_group_low_tvshows.drop(['index'], axis = 1)
 
netflix_roto_group_high_tvshows.head(5)
Out[54]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 100 393 194 123 96 11
1 90 291 115 104 89 9
2 80 164 65 62 49 1
3 70 107 35 35 35 4
4 60 78 29 26 28 1
In [55]:
hulu_roto_group_tvshows = roto_group_data_tvshows[roto_group_data_tvshows['Hulu'] !=  0].sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_roto_group_tvshows = hulu_roto_group_tvshows.drop(['index', 'Netflix', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
 
hulu_roto_group_high_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_roto_group_high_tvshows = hulu_roto_group_high_tvshows.drop(['index'], axis = 1)
 
hulu_roto_group_low_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Hulu', ascending = True).reset_index()
hulu_roto_group_low_tvshows = hulu_roto_group_low_tvshows.drop(['index'], axis = 1)
 
hulu_roto_group_high_tvshows.head(5)
Out[55]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 100 393 194 123 96 11
1 90 291 115 104 89 9
2 80 164 65 62 49 1
3 70 107 35 35 35 4
4 60 78 29 26 28 1
In [56]:
prime_video_roto_group_tvshows = roto_group_data_tvshows[roto_group_data_tvshows['Prime Video'] !=  0].sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_roto_group_tvshows = prime_video_roto_group_tvshows.drop(['index', 'Netflix', 'Hulu', 'Disney+', 'TV Shows Count'], axis = 1)
 
prime_video_roto_group_high_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_roto_group_high_tvshows = prime_video_roto_group_high_tvshows.drop(['index'], axis = 1)
 
prime_video_roto_group_low_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Prime Video', ascending = True).reset_index()
prime_video_roto_group_low_tvshows = prime_video_roto_group_low_tvshows.drop(['index'], axis = 1)
 
prime_video_roto_group_high_tvshows.head(5)
Out[56]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 100 393 194 123 96 11
1 90 291 115 104 89 9
2 80 164 65 62 49 1
3 70 107 35 35 35 4
4 50 68 26 16 29 2
In [57]:
disney_roto_group_tvshows = roto_group_data_tvshows[roto_group_data_tvshows['Disney+'] !=  0].sort_values(by = 'Disney+', ascending = False).reset_index()
disney_roto_group_tvshows = disney_roto_group_tvshows.drop(['index', 'Netflix', 'Hulu', 'Prime Video', 'TV Shows Count'], axis = 1)
 
disney_roto_group_high_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Disney+', ascending = False).reset_index()
disney_roto_group_high_tvshows = disney_roto_group_high_tvshows.drop(['index'], axis = 1)
 
disney_roto_group_low_tvshows = df_roto_group_high_tvshows.sort_values(by = 'Disney+', ascending = True).reset_index()
disney_roto_group_low_tvshows = disney_roto_group_low_tvshows.drop(['index'], axis = 1)
 
disney_roto_group_high_tvshows.head(5)
Out[57]:
Rotten Tomatoes Group TV Shows Count Netflix Hulu Prime Video Disney+
0 100 393 194 123 96 11
1 90 291 115 104 89 9
2 70 107 35 35 35 4
3 50 68 26 16 29 2
4 20 30 9 5 16 2
In [58]:
print(f'''
      The Rotten Tomatoes Group with Highest TV Shows Count Ever Got is '{df_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}' : '{df_roto_group_high_tvshows['TV Shows Count'].max()}'\n
      The Rotten Tomatoes Group with Lowest TV Shows Count Ever Got is '{df_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}' : '{df_roto_group_low_tvshows['TV Shows Count'].min()}'\n
      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Netflix' is '{netflix_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}' : '{netflix_roto_group_high_tvshows['Netflix'].max()}'\n
      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Netflix' is '{netflix_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}' : '{netflix_roto_group_low_tvshows['Netflix'].min()}'\n
      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Hulu' is '{hulu_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}' : '{hulu_roto_group_high_tvshows['Hulu'].max()}'\n
      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Hulu' is '{hulu_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}' : '{hulu_roto_group_low_tvshows['Hulu'].min()}'\n
      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Prime Video' is '{prime_video_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}' : '{prime_video_roto_group_high_tvshows['Prime Video'].max()}'\n
      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Prime Video' is '{prime_video_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}' : '{prime_video_roto_group_low_tvshows['Prime Video'].min()}'\n
      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Disney+' is '{disney_roto_group_high_tvshows['Rotten Tomatoes Group'][0]}' : '{disney_roto_group_high_tvshows['Disney+'].max()}'\n
      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Disney+' is '{disney_roto_group_low_tvshows['Rotten Tomatoes Group'][0]}' : '{disney_roto_group_low_tvshows['Disney+'].min()}'\n 
      ''')
      The Rotten Tomatoes Group with Highest TV Shows Count Ever Got is '100' : '393'

      The Rotten Tomatoes Group with Lowest TV Shows Count Ever Got is '10' : '18'

      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Netflix' is '100' : '194'

      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Netflix' is '10' : '7'

      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Hulu' is '100' : '123'

      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Hulu' is '20' : '5'

      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Prime Video' is '100' : '96'

      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Prime Video' is '10' : '6'

      
      The Rotten Tomatoes Group with Highest TV Shows Count on 'Disney+' is '100' : '11'

      The Rotten Tomatoes Group with Lowest TV Shows Count on 'Disney+' is '40' : '0'
 
      
In [59]:
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
 
n_ro_ax1 = sns.barplot(x = netflix_roto_group_tvshows['Rotten Tomatoes Group'][:10], y = netflix_roto_group_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_ro_ax2 = sns.barplot(x = hulu_roto_group_tvshows['Rotten Tomatoes Group'][:10], y = hulu_roto_group_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_ro_ax3 = sns.barplot(x = prime_video_roto_group_tvshows['Rotten Tomatoes Group'][:10], y = prime_video_roto_group_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_ro_ax4 = sns.barplot(x = disney_roto_group_tvshows['Rotten Tomatoes Group'][:10], y = disney_roto_group_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
 
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
 
n_ro_ax1.title.set_text(labels[0])
h_ro_ax2.title.set_text(labels[1])
p_ro_ax3.title.set_text(labels[2])
d_ro_ax4.title.set_text(labels[3])
 
plt.show()
In [60]:
plt.figure(figsize = (20, 5))
sns.lineplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'], y = roto_group_data_tvshows['Netflix'], color = 'red')
sns.lineplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'], y = roto_group_data_tvshows['Hulu'], color = 'lightgreen')
sns.lineplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'], y = roto_group_data_tvshows['Prime Video'], color = 'lightblue')
sns.lineplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'], y = roto_group_data_tvshows['Disney+'], color = 'darkblue')
plt.xlabel('Rotten Tomatoes Group', fontsize = 15)
plt.ylabel('TV Shows Count', fontsize = 15)
plt.show()
In [61]:
print(f'''
      Accross All Platforms Total Count of Rotten Tomatoes Group is '{roto_group_data_tvshows['Rotten Tomatoes Group'].unique().shape[0]}'\n
      Total Count of Rotten Tomatoes Group on 'Netflix' is '{netflix_roto_group_tvshows['Rotten Tomatoes Group'].unique().shape[0]}'\n
      Total Count of Rotten Tomatoes Group on 'Hulu' is '{hulu_roto_group_tvshows['Rotten Tomatoes Group'].unique().shape[0]}'\n
      Total Count of Rotten Tomatoes Group on 'Prime Video' is '{prime_video_roto_group_tvshows['Rotten Tomatoes Group'].unique().shape[0]}'\n
      Total Count of Rotten Tomatoes Group on 'Disney+' is '{disney_roto_group_tvshows['Rotten Tomatoes Group'].unique().shape[0]}'\n 
      ''')
      Accross All Platforms Total Count of Rotten Tomatoes Group is '10'

      Total Count of Rotten Tomatoes Group on 'Netflix' is '10'

      Total Count of Rotten Tomatoes Group on 'Hulu' is '10'

      Total Count of Rotten Tomatoes Group on 'Prime Video' is '10'

      Total Count of Rotten Tomatoes Group on 'Disney+' is '8'
 
      
In [62]:
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
 
n_ro_ax1 = sns.lineplot(y = roto_group_data_tvshows['Rotten Tomatoes Group'], x = roto_group_data_tvshows['Netflix'], color = 'red', ax = axes[0, 0])
h_ro_ax2 = sns.lineplot(y = roto_group_data_tvshows['Rotten Tomatoes Group'], x = roto_group_data_tvshows['Hulu'], color = 'lightgreen', ax = axes[0, 1])
p_ro_ax3 = sns.lineplot(y = roto_group_data_tvshows['Rotten Tomatoes Group'], x = roto_group_data_tvshows['Prime Video'], color = 'lightblue', ax = axes[1, 0])
d_ro_ax4 = sns.lineplot(y = roto_group_data_tvshows['Rotten Tomatoes Group'], x = roto_group_data_tvshows['Disney+'], color = 'darkblue', ax = axes[1, 1])
 
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
 
n_ro_ax1.title.set_text(labels[0])
h_ro_ax2.title.set_text(labels[1])
p_ro_ax3.title.set_text(labels[2])
d_ro_ax4.title.set_text(labels[3])

plt.show()
In [63]:
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
 
n_ro_ax1 = sns.barplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'][:10], y = roto_group_data_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_ro_ax2 = sns.barplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'][:10], y = roto_group_data_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_ro_ax3 = sns.barplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'][:10], y = roto_group_data_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_ro_ax4 = sns.barplot(x = roto_group_data_tvshows['Rotten Tomatoes Group'][:10], y = roto_group_data_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
 
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
 
n_ro_ax1.title.set_text(labels[0])
h_ro_ax2.title.set_text(labels[1])
p_ro_ax3.title.set_text(labels[2])
d_ro_ax4.title.set_text(labels[3])
 
plt.show()